#include <gtest/gtest.h>
#include "../stdlib/zrena.h"

// class ZrenaTest : public ::testing::Test {
// protected:
//   virtual void SetUp() {
//   }
  
//   UnsafeZrena* pzn;
//   pzn = new UnsafeZrena(1024);
// };

TEST(ZrenaTest, StatusTest) {
  UnsafeZrena* pzn;
  pzn = new UnsafeZrena(1024);
  EXPECT_EQ(1024, pzn->status().bytes_allocated());

  char *s = pzn->Alloc(100);
  snprintf(s, 100, "%s:%d", "192.168.60.1", 80);
  EXPECT_STREQ("192.168.60.1:80", s);
  pzn->Alloc(100);
  EXPECT_EQ(2048, pzn->status().bytes_allocated());
  pzn->Alloc(100);
  EXPECT_EQ(2048, pzn->status().bytes_allocated());
  delete pzn;
}
